package com.zj.sixtyDayChallenge.str;

/**
 * @program: algorithm
 * @description: 反转字符串
 * 344 reverse-string
 * @author: Zhang Bo
 * @create: 2023-02-08 14:39:05
 **/
public class ReverseString {
    public static void main(String[] args) {
        Solution solution = new ReverseString().new Solution();
    }

    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public void reverseString(char[] s) {

            int l = 0;
            int r = s.length - 1;
            while (l != r && l - 1 != r) {
                char temp = s[l];
                s[l] = s[r];
                s[r] = temp;

                l++;
                r--;
            }

        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}
